﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tiscs.Practices.Web.Services.Client
{
    /// <summary>
    /// 用户登录参数。
    /// </summary>
    public class SignInParameters
    {
        /// <summary>
        /// 构造方法。
        /// </summary>
        /// <param name="userName">用户名。</param>
        /// <param name="password">密码。</param>
        /// <param name="isPersistent">是否持久登录。</param>
        /// <param name="customData">自定义凭据。</param>
        public SignInParameters(string userName, string password, bool isPersistent, string customData)
        {
            _userName = userName;
            _password = password;
            _isPersistent = isPersistent;
            _customData = customData;
        }

        /// <summary>
        /// 构造方法。
        /// </summary>
        /// <param name="userName">用户名。</param>
        /// <param name="password">密码。</param>
        public SignInParameters(string userName, string password)
            : this(userName, password, false, null)
        {
        }

        /// <summary>
        /// 构造方法。
        /// </summary>
        public SignInParameters()
            : this(null, null)
        {
        }

        private readonly string _userName;

        /// <summary>
        /// 用户名。
        /// </summary>
        public string UserName
        {
            get
            {
                return _userName;
            }
        }

        private readonly string _password;

        /// <summary>
        /// 密码。
        /// </summary>
        public string Password
        {
            get
            {
                return _password;
            }
        }

        private readonly bool _isPersistent;

        /// <summary>
        /// 是否持久登录。
        /// </summary>
        public bool IsPersistent
        {
            get
            {
                return _isPersistent;
            }
        }

        private readonly string _customData;

        /// <summary>
        /// 自定义凭据。
        /// </summary>
        public string CustomData
        {
            get
            {
                return _customData;
            }
        }
    }
}
